package com.gxuwz.drivemaster;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public class SubjectOneFragment extends Fragment {
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater,
                            @Nullable ViewGroup container,
                            @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.activity_subject_one, container, false);
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        Button btnPractice = view.findViewById(R.id.btn_practice);
        btnPractice.setOnClickListener(v -> {
            Intent intent = new Intent(getActivity(), QuizActivity.class);
            intent.putExtra("mode", "practice");
            startActivity(intent);
        });

        Button btnExamine = view.findViewById(R.id.btn_examine);
        btnExamine.setOnClickListener(v -> {
            Intent intent = new Intent(getActivity(), MoniActivity.class);
            intent.putExtra("mode", "exam");
            startActivity(intent);
        });
    }
}
